import React, { Component } from 'react'
import classnames from 'classnames'
import './05_style.css'
export default class App extends Component {
  // 定义了初始化的状态 --- 先使用后讲解
  state = {
    finished: false
  }
  render() {
    // 群组样式通过 classnames 模块 组合成一个对象
    // 通过条件判断完成
    const btnClass = classnames({
      btn: true,
      'btn-success': this.state.finished,
      'btn-fail': !this.state.finished
    })

    return (
      <button className = { btnClass }>classnames 按钮</button>
    )
  }
}
